package bookstudytest.proxy.intercepter;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @author: Lee
 * @Date: 2019/3/8 0008 14:44
 * @Description:
 */
public class IntercepterByJdkImpl implements IntercepterByJdk {


    public boolean before(Object o, Object target, Method method, Object[] args) {
        System.out.println("method invoke before");
        return true;
    }

    public Object around(Object o, Object target, Method method, Object[] args) throws InvocationTargetException, IllegalAccessException {
        System.out.println("method invoke around before");
        Object invoke = method.invoke(target, args);
        System.out.println("method invoke around after");
        return invoke;
    }

    public void after(Object o, Object target, Method method, Object[] args) {
        System.out.println("method invoke after");

    }
}
